package com.xbkj.pgrp.server.model.app;

import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.Search;
import xyz.erupt.jpa.model.BaseModel;
import xyz.erupt.upms.model.base.HyperModel;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 客户基本信息
 */
@Erupt(
        name = "Customer"
)
@Table(name = "pgrp_customer")
@Entity
public class Customer extends HyperModel {
    @EruptField(
            views = @View(title = "客户名称"),
            edit = @Edit(title = "客户名称", notNull = true, search = @Search(vague = true)),
            sort = 0
    )
    @Column(nullable = false)
    private String name;

    @EruptField(
            views = @View(title = "客户编号"),
            edit = @Edit(title = "客户编号", notNull = true, search = @Search(vague = true)),
            sort = 1
    )
    @Column(nullable = false)
    private String code;

    @EruptField(
            views = @View(title = "客户地址"),
            edit = @Edit(title = "客户地址", notNull = true, type = EditType.TEXTAREA)
    )
    @Column(length = 1024, nullable = false)
    private String address;
}
